﻿Public Class ToolbarBalance
    Dim curr As New Currency

    Public Sub CheckBalance(Debet As Decimal, Credit As Decimal)
        Dim balance As Decimal = Debet - Credit
        txtTotalDebet.Text = curr.dec2curr(Debet)
        txtTotalCredit.Text = curr.dec2curr(Credit)
        txtSpell.Text = curr.NumberToString(Debet)
        If (balance <> 0) Then
            lblErrorBalance.Text = "Error Balance : " + balance.ToString("N2", System.Globalization.CultureInfo.CreateSpecificCulture("en-US"))
            lblErrorBalance.Visible = True
            txtSpell.Text = ""
        Else : lblErrorBalance.Visible = False
        End If
    End Sub
End Class
